interface A {
  name: string;
  age: number;
  // sex: boolean;
}

interface B {
  name: string;
  age: number;
  sex: boolean;
}

let a:A = {
  name: 'li',
  age: 18
}

let b:B = {
  name: 'lixiao',
  age: 33,
  sex: true
}
 
// 协变
a = b
b = a // 报错：类型 "A" 中缺少属性 "sex"，但类型 "B" 中需要该属性

let fna = (a: A) => {}
let fnb = (b: B) => {}

// 逆变
fnb = fna
fna = fnb // 报错
export {}